home *** CD-ROM | disk | FTP | other *** search
- ' ** Locatorberechnungsprogramm fuer Atari ST mit Monochrommonitor **
- Dim M_text$(29)
- P=3.14159
- K=P/180
- Do
- Read M_text$(I%)
- Exit If M_text$(I%)=" Quit "
- Inc I%
- Loop
- Hidem
- Deftext 1,17,0,30
- Text 180,40," IARU - Locator"
- Deftext 1,0,0,4
- Text 120,100," August/September '89"
- Text 120,109," von Manfred Baier - DG8MEQ"
- Text 120,118,"mit unentbehrlicher Unterstuetzung von Astrid Baier - DG9MEQ"
- Text 120,127," Algorithmen:Erich Vogelsang "
- Deftext 1,0,0,6
- Text 100,200,"Dieses Programm ermittelt den weltweiten Locator aus"
- Text 100,220,"oestlicher Laenge und Breite oder umgekehrt,und berech-"
- Text 100,240,"net Entfernung und Winkel zu einer beliebigen Gegen-"
- Text 100,260,"station auf der Erde."
- Text 100,280,"Die Laenge und Breite muss in Grad und Minuten eingegeben"
- Text 100,300,"werden (nicht Dezimal).Die Ausgabe erfolgt jedoch Dezi-"
- Text 100,320,"mal."
- Gosub Mausbox
- Gosub Pulldown
- Procedure Pulldown
- Cls
- Menu M_text$()
- On Menu Gosub Berechnung
- Print At(65,1);Time$;" MEZ"
- Do
- On Menu
- Loop
- Return
- Procedure Mausbox
- Hidem
- Color 0
- Deffill 1,2,8
- Pbox 230,345,407,370
- Defline 1,1,0,0
- Box 233,348,404,367
- Graphmode 2
- Deftext 0,0,0,6
- Text 240,360,"Weiter mit Maustaste"
- Color 1
- Graphmode 1
- Repeat
- Until Mousek
- Showm
- Return
- Procedure Berechnung
- Cls
- M_text$=M_text$(Menu(0))
- If M_text$=" Locator "
- Gosub Locator
- Endif
- If M_text$=" Laenge und Breite "
- Gosub Laenge_und_breite
- Endif
- If M_text$=" JN57NU "
- A$="JN57NU"
- Goto Jn57nu
- Endif
- If M_text$=" L 11.8 - B 47.50 "
- L1=11
- L2=8
- B1=47
- B2=50
- Goto Ec
- Endif
- If M_text$=" Locator Info "
- Gosub Info
- Endif
- If M_text$=" Quit "
- End
- Endif
- If M_text$=" Anleitung "
- Gosub Anleitung
- Endif
- Menu Off
- Return
- Procedure Info
- Alert 1," LOCATOR BERECHNUNG | A.und M.Baier 9/89 | DG9MEQ - DG8MEQ ",1,"OK",Button%
- Gosub Pulldown
- Return
- Data Desk, Locator Info ,--------------------,1,2,3,4,5,6,""
- Data Eingabe, Locator , Laenge und Breite ,--------------------, JN57NU , L 11.8 - B 47.50 ,""
- Data Hilfe, Anleitung ,
- Data Ende, Quit ,
- Procedure Locator
- Print " Eigener Locator ";
- Input A$
- Jn57nu:
- Gosub Locatoreingabe_pruefen
- Gosub Locator_in_laenge_und_breite
- H$=A$
- V=Y
- V1=Y1
- U=X
- U1=X1
- Cls
- Print At(6,3);"Eigener Locator: ";H$;" Laenge:";V1;" Grad Breite:";U1;" Grad"
- Print At(6,4);"Locator Gegenstation";
- Input A$
- Gosub Locatoreingabe_pruefen
- Gosub Locator_in_laenge_und_breite
- Gosub Entfernung_und_winkel
- Print At(6,4);"-------------------------------------------------------------------"
- Print At(6,5);"Locator: ";A$;" Laenge:";Y1;" ";X1;
- Print At(49,5);"Grad"
- Print At(55,5);"Breite:"
- Print At(68,5);"Grad"
- Print At(6,7);"Entfernung: ";D2;" km ";
- Print At(6,8);"Winkel: ";W2;" Grad"
- Print
- Gosub Mausbox
- Gosub Pulldown
- Return
- Procedure Laenge_und_breite
- Print At(3,10);"Eigene Laenge (Grad,Minuten)";
- Input L1,L2
- Gosub Ueberpruefung_der_laengeneingabe
- Print At(3,11);"Eigene Breite (Grad,Minuten)";
- Input B1,B2
- Gosub Ueberpruefung_der_breiteneingabe
- Ec:
- Gosub Laenge_und_breite_in_standortkenner
- H$=A$
- V=Y
- V1=Y1
- U=X
- U1=X1
- Cls
- Print At(6,3);" Eigener Locator: ";H$;" Laenge:";V1;" Grad Breite:";U1;" Grad"
- Print At(7,4);"-------------------------------------------------------------------"
- Print At(3,10);" Laenge Gegenstation (Grad,Minuten)";
- Input L1,L2
- Gosub Ueberpruefung_der_laengeneingabe
- Print At(3,11);" Breite Gegenstation (Grad,Minuten)";
- Input B1,B2
- Gosub Ueberpruefung_der_breiteneingabe
- Gosub Laenge_und_breite_in_standortkenner
- Gosub Entfernung_und_winkel
- Print At(3,10);" "
- Print At(3,11);" "
- Print At(7,5);"Locator: ";A$;" Laenge:";Y1;" Grad Breite:";X1;" Grad"
- Print At(7,7);"Entfernung: ";D2;" km"
- Print At(7,8);"Winkel: ";W2;" Grad"
- Gosub Mausbox
- Gosub Pulldown
- Return
- Procedure Locatoreingabe_pruefen
- If Len(A$)<>6
- Gosub Meldung
- Endif
- B$=Mid$(A$,1,1)
- If B$>="a" And B$<="r"
- B$=Chr$(Asc(B$)-32)
- Endif
- If B$<"A" Or B$>"R"
- Gosub Meldung
- Endif
- C$=Mid$(A$,2,1)
- If C$>="a" And C$<="r"
- C$=Chr$(Asc(C$)-32)
- Endif
- If C$<"A" Or C$>"R"
- Gosub Meldung
- Endif
- D$=Mid$(A$,3,1)
- If D$<"0" Or D$>"9"
- Gosub Meldung
- Endif
- E$=Mid$(A$,4,1)
- If E$<"0" Or E$>"9"
- Gosub Meldung
- Endif
- F$=Mid$(A$,5,1)
- If F$>="a" And F$<="x"
- F$=Chr$(Asc(F$)-32)
- Endif
- If F$<"A" Or F$>"X"
- Gosub Meldung
- Endif
- G$=Mid$(A$,6,1)
- If G$>="a" And G$<="x"
- G$=Chr$(Asc(G$)-32)
- Endif
- If G$<"A" Or G$>"X"
- Gosub Meldung
- Endif
- A$=B$+C$+D$+E$+F$+G$ !Kleinschreibung aendern
- Return
- Procedure Meldung
- Print Chr$(7)
- Alert 1,"Nur AA00AA - RR99XX moeglich",1,"Nochmal",Button
- Print At(26,4);" "
- Print At(26,4);"";
- Input A$
- Gosub Locatoreingabe_pruefen
- Return
- Procedure Ueberpruefung_der_laengeneingabe
- If L1<>Int(L1)
- Gosub Meldungl
- Endif
- If L1<0 Or L1>359
- Gosub Meldungl
- Endif
- If L2<>Int(L2)
- Gosub Meldungl
- Endif
- If L2<0 Or L2>59
- Gosub Meldungl
- Endif
- Return
- Procedure Meldungl
- Print Chr$(7)
- Alert 1," Laenge nur 0 ... 359, 0 ... 59 moeglich",1,"Nochmal",Button
- Print At(45,10);" "
- Print At(45,10);"";
- Input L1,L2
- Gosub Ueberpruefung_der_laengeneingabe
- Return
- Procedure Ueberpruefung_der_breiteneingabe
- If Sgn(B1)+Sgn(B2)<>0 !Breite mit negativem Vorzeichen
- If B1<>Int(B1)
- Gosub Meldungb
- If B1<>0
- Gosub Meldungb
- Endif
- Endif
- Endif
- If B1<-89 Or B1>89
- Gosub Meldungb
- Endif
- If B2<>Int(B2)
- Gosub Meldungb
- Endif
- If B2<-59 Or B2>59
- Gosub Meldungb
- Endif
- Return
- Procedure Meldungb
- Print Chr$(7)
- Alert 1," Breite nur 0 ... 89, 0 ... 59| oder 0...-89, 0...-59 moeglich",1,"Nochmal",Button
- Print At(45,11);" "
- Print At(45,11);"";
- Input B1,B2
- Gosub Ueberpruefung_der_breiteneingabe
- Return
- Procedure Locator_in_laenge_und_breite
- If B$<"J"
- B=180+(Asc(B$)-83)*20
- Else
- B=(Asc(B$)-74)*20
- Endif
- C=(Asc(C$)-74)*10
- D=(Asc(D$)-48)*2
- E=Asc(E$)-48
- F=(Asc(F$)-64.5)/12
- G=(Asc(G$)-64.5)/24
- Y=B+D+F
- Y1=Int(100*Y+0.5)/100
- X=C+E+G
- X1=Int(100*X+0.5)/100
- Return
- Procedure Laenge_und_breite_in_standortkenner
- Y=L1+L2/60
- Y1=Int(100*Y+0.5)/100
- B=Int(L1/20)
- D=Int((L1-20*B)/2)
- F=Int(L2/5)+((L1-20*B)/2-D)*24
- If L1>=180
- B$=Chr$(B+56)
- Else
- B$=Chr$(B+74)
- Endif
- D$=Chr$(D+48)
- F$=Chr$(F+65)
- X=B1+B2/60
- X1=Int(100*X+0.5)/100
- If B2>=0
- C=Int(B1/10)
- Else
- B1=B1-1
- B2=B2+60
- Endif
- C=Int(B1/10)
- E=B1-10*C
- G=Int(B2/2.5)
- C$=Chr$(C+74)
- E$=Chr$(E+48)
- G$=Chr$(G+65)
- A$=B$+C$+D$+E$+F$+G$
- Return
- Procedure Entfernung_und_winkel
- If A$=H$
- D2=0
- W2=0
- Else
- D0=Sin(K*U)*Sin(K*X)+Cos(K*U)*Cos(K*X)*Cos(K*(Y-V))
- If D0>=1
- D2=0
- W2=0
- Else
- If D0=0
- D1=P/2
- Else
- If D0<=-1
- D1=P
- Else
- D1=Atn(Sqr(1-D0*D0)/D0)
- If D0<=0
- D1=D1+P
- Endif
- Endif
- Endif
- Endif
- D2=Int(6370*D1)
- Endif
- If D0>=1 Or D0<=-1
- W2=0
- Else
- W0=(Sin(K*X)-Sin(K*U)*Cos(D1))/(Cos(K*U)*Sin(D1))
- If W0>=1
- W2=0
- Else
- If W0<=-1
- W1=P
- Else
- W1=P/2-Atn(W0/Sqr(1-W0*W0))
- If Y-V>0 And Y-V<180 Or Y-V<-180
- W2=Int(W1/K)
- Else
- W1=2*P-W1
- W2=Int(W1/K)
- Endif
- Endif
- Endif
- Endif
- Return
- Procedure Anleitung
- Print
- Print " Bedienungshinweise fuer das Programm."
- Print " ------------------------------------"
- Print
- Print " Die jeweils feststehenden Eingaben 'JN57NU' und 'L 11.8 - B 47.50'"
- Print " sind die Daten des Autors.Dort koennen die eigenen Daten des Benutzers"
- Print " eingetragen werden.In den meissten Faellen wird diese Funktion sehr"
- Print " Sinnvoll sein."
- Print " Ansonsten erklaert sich das Programm eigentlich von alleine."
- Print " Das Programm ist gegen die meisten Fehleingaben geschuetzt."
- Print " Es kann allerdings vorkommen,dass besondere Spezialisten diesen Rahmen"
- Print " sprengen.Im Zweifelsfall muss das Programm noch einmal gestartet werden!"
- Gosub Mausbox
- Gosub Pulldown
- Return
- ' Das Programm laeuft in GFA-Basic,Version 2
- ' mit Merge in den Interpreter......(kennt ja jeder)
- ' Fuer eine Druckerausgabe hatte ich keine Lust mehr.Das kommt vielleicht noch.
- ' 73 Astrid und Manfred - DG9MEQ,DG8MEQ - C20
-
-